home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickTime / Programming Stuff / Sample Code / Music Architecture / Mixed Bag / •QTMusic Sample Sequencer / Event Priority Queue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-19  |  1.3 KB  |  75 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        Event Priority Queue.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <3+>     5/19/93    dvb        New calls for sorting.
  13.          <3>     9/17/92    dvb        Flush call
  14.         <1+>     5/11/92    dvb        It's mine, and I'm going to work on it.
  15.          <1>     5/10/92    dvb        first checked in
  16.  
  17. */
  18.  
  19. /*
  20.  * file: Event Priority Queue.h
  21.  *
  22.  *
  23.  */
  24.  
  25.  
  26. #ifndef _EventPriorityQueue_
  27. #define _EventPriorityQueue_
  28.  
  29.  
  30.  
  31. /*--------------------------
  32.     Inclusions
  33. --------------------------*/
  34.  
  35. #include <types.h>
  36.  
  37. /*--------------------------
  38.     Structures
  39. --------------------------*/
  40. typedef struct
  41.     {
  42.     long time;
  43.     long data1;
  44.     long data2;
  45.     long data3;
  46.     } EPQEvent;
  47.  
  48. typedef struct
  49.     {
  50.     long size;        /* number of Events in queue */
  51.     long maxSize;    /* number of Events possible */
  52.     EPQEvent e[1];
  53.     } EPQ;
  54.  
  55. #define kEPQEmpty 0x7fffFFFF
  56.  
  57. /*--------------------------
  58.     Prototypes
  59. --------------------------*/
  60.  
  61. EPQ *NewEPQ(long maxSize);
  62. short DisposeEPQ(EPQ *q);
  63.  
  64. short AddEventEPQ(EPQ *q, const EPQEvent *inEvent);
  65. long PeekTopEPQ(EPQ *q);
  66. EPQEvent *PeekIndexedEPQ(EPQ *q,long index);
  67. long GetSizeEPQ(EPQ *q);
  68. void ExtractEventEPQ(EPQ *q, EPQEvent *outEvent);
  69. void FlushEPQ(EPQ *q);
  70. void SortEPQ(EPQ *q);
  71.  
  72.  
  73.  
  74. #endif _EventPriorityQueue_
  75.